﻿//#ifndef INSTRUCTIONWAIT_H
//#define INSTRUCTIONWAIT_H

#pragma once
#include <QObject>

#include "ScriptInstruction.h"

class InstructionWait :public ScriptInstruction
{
  Q_OBJECT
private:
  int interval = 0;
  ScriptRunner* scriptRunner = Q_NULLPTR;
public:
  InstructionWait(int interval)
  {
    this->interval = interval;
    scriptRunner = ScriptInstruction::getScriptRunner();
    instructionFlag = MetaInstruction_Wait;
  }
  ~InstructionWait()
  {}
public:
  void run()override
  {
    scriptRunner->scriptWaitAndRun(interval);
  }
  QVector<float> getDataForSaving()override
  {
    QVector<float> savingData;
    savingData.append(instructionFlag);
    return savingData;
  }
};
